home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Utilities / Mac⁄gnuucp 6.14 / source / mellon getstring diffs < prev    next >
Encoding:
Text File  |  1993-06-12  |  3.8 KB  |  150 lines  |  [TEXT/R*ch]

  1. To: jim@fpr.com
  2. Subject: Re: Stupid question... 
  3. Date: Sat, 12 Jun 93 13:47:25 PDT
  4. From: Ted Lemon <mellon@hemlock.ncd.com>
  5.  
  6.  
  7. Hokay.   Here's the diffs (sorry about the reindentation - I was
  8. experiencing some severe reality clashes with an unbalanced brace, so
  9. I went through the entire getstring function reindenting it):
  10.  
  11. diff -rbc2 gnuucp/Source/gnuucp.c nuucp/Source/gnuucp.c
  12. *** gnuucp/Source/gnuucp.c    Sat Jun 12 13:29:24 1993
  13. --- nuucp/Source/gnuucp.c    Sat Jun 12 13:28:29 1993
  14. ***************
  15. *** 183,193 ****
  16.    */
  17.   int
  18. ! getstring(where)
  19.       register char *where;
  20.   {
  21.       register int data, count = 0;
  22.       DEBUG(8, "Getstring:  ", 0);
  23.       /* Read data until null character */
  24. !     while ( (long)((data = xgetc()) != (long)EOF)) {
  25.           data &= 0x7F;
  26.           if (DEBUG_LEVEL(8)) 
  27. --- 183,198 ----
  28.    */
  29.   int
  30. ! getstring(where, maxi)
  31.       register char *where;
  32. +     register int maxi;
  33.   {
  34.       register int data, count = 0;
  35.       DEBUG(8, "Getstring:  ", 0);
  36. +     
  37. +     --maxi; /* Leave space for NUL terminator... */
  38. +     
  39.       /* Read data until null character */
  40. !     while ( (long)((data = xgetc()) != (long)EOF))
  41. !     {
  42.           data &= 0x7F;
  43.           if (DEBUG_LEVEL(8)) 
  44. ***************
  45. *** 200,207 ****
  46.           if (data == 0x00 && count != 0) 
  47.               {
  48. !                 if (DEBUG_LEVEL(8)) putchar('\n');
  49.                       return SUCCESS;
  50.                       }
  51.           }
  52.       if (DEBUG_LEVEL(8)) putchar('\n');
  53.       return FAIL;
  54. --- 205,218 ----
  55.           if (data == 0x00 && count != 0) 
  56.           {
  57. !             if (DEBUG_LEVEL(8))
  58. !                 putchar('\n');
  59.               return SUCCESS;
  60. +         } else {
  61. +             if (count == maxi) {
  62. +                 where [count] = '\0';
  63. +                 return SUCCESS;
  64.               }
  65.           }
  66. +     }
  67.       if (DEBUG_LEVEL(8)) putchar('\n');
  68.       return FAIL;
  69. ***************
  70. *** 983,987 ****
  71.               goto bort1; */
  72.       again:
  73. !         if (getstring(msgbuf) != SUCCESS)
  74.               goto bort1;
  75.           /* printf("MSGBUF: %s\n", msgbuf); */
  76. --- 994,998 ----
  77.               goto bort1; */
  78.       again:
  79. !         if (getstring(msgbuf, sizeof msgbuf) != SUCCESS)
  80.               goto bort1;
  81.           /* printf("MSGBUF: %s\n", msgbuf); */
  82. ***************
  83. *** 1014,1018 ****
  84.   
  85.       /* wait for ok message */
  86. !     if (getstring(msgbuf) != SUCCESS)
  87.           goto bort1;
  88.       if (msgbuf[0] != 'R')
  89. --- 1025,1029 ----
  90.   
  91.       /* wait for ok message */
  92. !     if (getstring(msgbuf, sizeof msgbuf) != SUCCESS)
  93.           goto bort1;
  94.       if (msgbuf[0] != 'R')
  95. ***************
  96. *** 1027,1031 ****
  97.        * FIXME, should scan our table versus theirs.
  98.        */
  99. !     if (getstring(msgbuf) != SUCCESS)
  100.           goto bort1;
  101.       if (msgbuf[0] != 'P')
  102. --- 1038,1042 ----
  103.        * FIXME, should scan our table versus theirs.
  104.        */
  105. !     if (getstring(msgbuf, sizeof msgbuf) != SUCCESS)
  106.           goto bort1;
  107.       if (msgbuf[0] != 'P')
  108. ***************
  109. *** 1123,1127 ****
  110.   /* FIXME, handle this kludge */
  111.   /*    if (instr(msgi2,sizeof(msgi2)-1), 1) */
  112. !     if (getstring(trash) != SUCCESS || trash[0] != 'S')
  113.           goto bort;
  114.   
  115. --- 1134,1138 ----
  116.   /* FIXME, handle this kludge */
  117.   /*    if (instr(msgi2,sizeof(msgi2)-1), 1) */
  118. !     if (getstring(trash, sizeof trash) != SUCCESS || trash[0] != 'S')
  119.           goto bort;
  120.   
  121. ***************
  122. *** 1133,1137 ****
  123.       /* FIXME, make the protocol list here, and use it */
  124.       twrite(msgo3a,sizeof(msgo3a)-1);
  125. !     if (getstring(trash) != SUCCESS) goto bort;
  126.       if (!strchr(trash+1, curproto->p_id)) 
  127.           {
  128. --- 1144,1148 ----
  129.       /* FIXME, make the protocol list here, and use it */
  130.       twrite(msgo3a,sizeof(msgo3a)-1);
  131. !     if (getstring(trash, sizeof trash) != SUCCESS) goto bort;
  132.       if (!strchr(trash+1, curproto->p_id)) 
  133.           {
  134. diff -rbc2 gnuucp/Source/gnuucp_proto.h nuucp/Source/gnuucp_proto.h
  135. *** gnuucp/Source/gnuucp_proto.h    Sat Jun 12 13:29:25 1993
  136. --- nuucp/Source/gnuucp_proto.h    Sat Jun 12 13:28:31 1993
  137. ***************
  138. *** 19,23 ****
  139.   /* GNUUCP.c */
  140.   
  141. ! int getstring(char *);
  142.   int instr(char *, int, int);
  143.   int twrite(char *, int);
  144. --- 19,23 ----
  145.   /* GNUUCP.c */
  146.   
  147. ! int getstring(char *, int);
  148.   int instr(char *, int, int);
  149.   int twrite(char *, int);
  150.